Color.fromString Method

Parses a color from a string.
 
 
Static This method is static.

Parameters

str

Type: String
The string to use to create the color.

Return Value


Type: Color
The color value or null if the color could not be parsed. 

Examples

This sample demonstrates the different ways to get a Color object that represents the color Red.




var redColor = dundas.controls.Color.fromString('Red');

redColor = dundas.controls.Color.fromString('#FFFF0000');

redColor = dundas.controls.Color.fromString('rgb(255,0,0)');